package experiment;

/**
 * @ClassName ListToStreamExample
 * @Date 2024/11/26 10:50 01
 * @Author Jack Chen
 * @Description serenity-cucumber-auto-project-jack
 * @Version 1.0
 */

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

public class ListToStreamExample {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("a", "b", "c", "d");

        // 转换为流
        Stream<String> stream = list.stream();

        // 打印流中的元素
        stream.forEach(System.out::println);
    }
}